package com.example.demo.indicator;

import org.springframework.boot.actuate.info.Info;
import org.springframework.boot.actuate.info.InfoContributor;
import org.springframework.stereotype.Component;

import java.util.Collections;

/**
 * 自定义info信息
 */
@Component
public class MyInfoContributor implements InfoContributor {
    /**
     * 自定义监控的info信息
     * @param builder
     */
    @Override
    public void contribute(Info.Builder builder) {
        builder.withDetail("status","mytest").withDetails(Collections.singletonMap("demoName","测试"));
    }
}
